package com.eureka.eurekac.controller;

import com.eureka.eurekac.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EurecaClient1Controller {

    @Value("8922")
    String port;

    @RequestMapping("/hello")
    public String home(@RequestParam String name) {
        return "Hello," + name + "，call successfully, service on port:" + port;
    }

    @RequestMapping("/helloBody")
    public String helloBody(@RequestBody User user) {
        return "HelloBody," + user.getName() + ", call successfully, service on port : " + port;
    }
}
